<h2><?php __($tenct['Ctrinh'] ['tenctrinh']);?></h2>

<?php
echo $this->Html->script('prototype'); 
echo $this->Html->script('effects'); 
echo $this->Html->script('custom_scripts'); 
	//echo $javascript->link('prototype');
   // echo $javascript->link('scriptaculous');
    // echo $javascript->link('effects');
     // echo $javascript->link('controls');
?>

<script>
<!--
var req;

function loadXMLDoc(url) {

   // Internet Explorer
   try { req = new ActiveXObject("Msxml2.XMLHTTP"); }
   catch(e) {
      try { req = new ActiveXObject("Microsoft.XMLHTTP"); }
      catch(oc) { req = null; }
   }

   // Mozailla/Safari
   if (!req && typeof XMLHttpRequest != "undefined") { req = new XMLHttpRequest(); }

   // Call the processChange() function when the page has loaded
   if (req != null) {
      req.onreadystatechange = processChange;
      req.open("GET", url, true);
      req.send(null);
   }
}

function processChange() {
   // The page has loaded and the HTTP status code is 200 OK
   if (req.readyState == 4 && req.status == 200) {

      // Write the contents of this URL to the searchResult layer
      getObject("searchResult").innerHTML = req.responseText;
   }
}

function getObject(name) {
   var ns4 = (document.layers) ? true : false;
   var w3c = (document.getElementById) ? true : false;
   var ie4 = (document.all) ? true : false;

   if (ns4) return eval('document.' + name);
   if (w3c) return document.getElementById(name);
   if (ie4) return eval('document.all.' + name);
   return false;
}

window.onload = function() {
   getObject("q").focus();
}

// -->
</script>
<p align="center">Gõ tìm tên công văn</p>
<input style="width: 300px; margin: 10px auto 0px 300px; font-size: 1.2em; font-weight: bold;" type="text" name="q" id="q" size="20" onkeyup="loadXMLDoc('thuyetminhs/timbb/'+this.value)" />
<div align="left" id="searchResult" name="searchResult" style="font-family:Arial; font-size:12px; border:none; padding:3px; "></div>
<h3>Danh sách các công văn (thuyết minh) đã có</h3>
<table cellpadding="0" cellspacing="0">
   <tr>
         <th><?php echo 'STT';?></th>
         <th><?php echo 'Tên quyết định';?></th>
         <th><?php echo 'Hành động';?></th>
   </tr>
   <?php
   $i = 0;
   foreach ($bbs as $k):
      $class = null;
      if ($i++ % 2 == 0) {
         $class = ' class="altrow"';
      }

   ?>
   <tr<?php echo $class;?>>
      <td><?php echo $i; ?>&nbsp;</td>
      <td><?php echo $k ['Thuyetminh'] ['digiaitm']; ?>&nbsp;</td>
         <td class="actions">
      <?php echo $this->Html->link(__('Delete', true), array('action' => 'delete', $k ['Thuyetminh'] ['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $k ['Thuyetminh'] ['digiaitm'])); ?>
         </td>
   </tr>
<?php endforeach; ?>
   </table>
